home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr11 / deepdran.zip / DEEPDRAN.C next >
C/C++ Source or Header  |  1993-06-01  |  693b  |  38 lines

  1. /* this routine does a deep drain on the battery */
  2.  
  3. #include <CONIO.H>
  4. #include <STDIO.H>
  5.  
  6. main()
  7.  
  8. {
  9.     unsigned char block;
  10.     unsigned long count;
  11.  
  12.     block = ' ';
  13.  
  14.     printf ("\n\nDeepDrain by Steven Polsky\n\n");
  15.  
  16.     printf ("Deep Draining your laptop battery makes it recharge more completely.\n");
  17.     printf ("Run this program until ██ stops flashing, or press any key to abort.\n\n");
  18.  
  19.     while (! kbhit()) {
  20.         printf ("Deep Draining Battery  %c%c\r", block, block);
  21.  
  22.         if (block == ' ') {
  23.             block = '█';
  24.         }
  25.         else {
  26.             block = ' ';
  27.         }
  28.  
  29.         /* pause */
  30.         for (count = 1; count < 100000; count++) {
  31.         }
  32.     }
  33.  
  34.     printf ("\n\nDeepDrain aborted!\n\n");
  35.  
  36.     return(1);
  37. }
  38.